#ifndef __DKGL_OBB_H__
#define __DKGL_OBB_H__

#include "dkglBounding.h"
#include "dkglFwdDec.h"
#include "dkglVector3.h"
#include "dkglMaterial.h"

namespace DKGL
{
	namespace bounding
	{
		class OrientedBoundingBox : public Bounding
		{
		public:

			OrientedBoundingBox(float sizex, float sizey, float sizez);

			~OrientedBoundingBox();

			virtual Vector3 getCenter() const;

			Drawable* getDrawable() const;

			Vector3 getAxis(int i) const
			{
				return _worldAxis[i];
			}

			virtual void show(bool);

			void setWorldTransformation(const float*);

			float getDN(const Vector3&) const;

			Vector3 _worldAxis[3];
			Vector3 _worldPosition;
			Vector3 _size;

			static bool testIntersection(
				const OrientedBoundingBox& a,
				const OrientedBoundingBox& b
				);

			static bool testSeparatingAxis(
				const Vector3& sepAxis,
				const OrientedBoundingBox& a,
				const OrientedBoundingBox& b
				);
		private:

			bool			_show;
			primitive::Box* _box;
			MaterialPtr		_boxMat;
	

		};
	}
}

#endif